<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content">个人信息</block>
		</cu-custom>
		<view class="cu-form-group margin-top">
			<view class="title cuIcon-profile text-blue"></view>
			<text class="title text-blue">姓名</text>
			<input name="input" v-model="userInfo.username"></input>
		</view>
		<view class="cu-form-group">
			<view class="title cuIcon-peoplefill text-blue"></view>
			<text class="title text-blue">真实姓名</text>
			<input name="input" v-model="userInfo.realname"></input>
		</view>
		<view class="cu-form-group">
			<view class="title cuIcon-female text-blue"></view>
			<text class="title text-blue">性别</text>
			<input name="input" v-model="userInfo.gender"></input>
		</view>
		<view class="cu-form-group">
			<view class="title cuIcon-present text-blue"></view>
			<text class="title text-blue">生日</text>
			<input name="input" v-model="userInfo.birthDate"></input>
		</view>
		<view class="cu-form-group">
			<view class="title cuIcon-like text-blue"></view>
			<text class="title text-blue">点数</text>
			<input name="input" v-model="userInfo.point"></input>
		</view>
		<view class="cu-form-group">
			<view class="title cuIcon-album text-blue"></view>
			<text class="title text-blue">邮箱</text>
			<input name="input" v-model="userInfo.email"></input>
		</view>
		<view class="cu-form-group">
			<view class="title text-blue cuIcon-vip"></view>
			<text class="title text-blue">会员等级</text>
			<input name="input" v-model="userInfo.level"></input>
		</view>
		<view class="cu-form-group">
			<view class="title text-blue cuIcon-card"></view>
			<text class="title text-blue">身份证号</text>
			<input name="input" v-model="userInfo.identityCardNo"></input>
		</view>
		<view class="cu-form-group">
			<view class="title text-blue cuIcon-record"></view>
			<text class="title text-blue">注册时间</text>
			<input name="input" v-model="userInfo.registerTime"></input>
		</view>
		<view class="cu-form-group">
			<view class="title text-blue cuIcon-mark"></view>
			<text class="title text-blue">平衡</text>
			<input name="input" v-model="userInfo.balance"></input>
		</view>
		<view class="cu-form-group">
			<view class="title cuIcon-phone text-blue sm"></view>
			<text class="title text-blue">手机号码</text>
			<input placeholder="输入框带标签"  v-model="userInfo.mobilePhone"></input>
			<view class="cu-capsule radius">
				<view class='cu-tag bg-blue '>
					+86
				</view>
				<view class="cu-tag line-blue">
					中国大陆
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {}
			}
		},
		methods: {
			init() {
				uni.showLoading({
					title: '正在加载数据！'
				})
				this.$storage.getStorage('user')
					.then(res => {
						return this.$api.api_getCustome('/customer/' + res.data.id)
					})
					.then(res => {
						this.userInfo = res.data.data;
						uni.hideLoading();
						uni.showToast({
							title: '数据加载成功！'
						})
					})
					.catch(error => {
						uni.showToast({
							title: error
						})
						uni.hideLoading();
					})
			}
		},
		onLoad() {
			this.init();
		}
	}
</script>

<style>

</style>
